package com.uusee.crawler.job;

import com.uusee.crawler.dbwriter.BaikeDbWriter;
import com.uusee.crawler.fetcher.FetchHTTP;
import com.uusee.crawler.model.CrawlStatusCodes;
import com.uusee.crawler.model.CrawlURI;
import com.uusee.crawler.pageprocessor.baike.BaikePageProcessor;
import com.uusee.crawler.pageprocessor.baike.mtime.MoviePlotsPageProcessor;
import com.uusee.crawler.pageprocessor.baike.mtime.RatingInterfacePageProcessor;
import com.uusee.crawler.xmlwriter.BaikeXmlWriter;
import com.uusee.shipshape.bk.model.Baike;

public class MtimePlotsCrawlJob {
	FetchHTTP fetch = new FetchHTTP();
	MoviePlotsPageProcessor pageProcessor = new MoviePlotsPageProcessor();
	BaikeXmlWriter xmlwriter = new BaikeXmlWriter();
	
	public CrawlURI createCrawlURI(String oriId) {
		CrawlURI crawlURI = new CrawlURI();
		String crawlUrl =  "http://www.mtime.com/database/ShowPlotService.m?Ajax_CallBack=true&Ajax_CallBackType=Mtime.Community.Controls.CommunityPages.ShowPlotService&Ajax_CallBackMethod=LoadData&Ajax_RequestUrl=http%3A%2F%2Fwww.mtime.com%2Fmovie%2F"+oriId+"%2Fplots.html&Ajax_CallBackArgument0=1&Ajax_CallBackArgument1="+oriId;
		crawlURI.setCrawlUrl(crawlUrl);
		crawlURI.setCrawlStatus(CrawlStatusCodes.DEFAULT_STATUS);
		crawlURI.setSourceSite("www.mtime.com");
		crawlURI.setCharset("utf-8");
		
		Baike baike = new Baike();
		baike.setSourceSite("www.mtime.com");
		baike.setOriId(oriId);
		crawlURI.setModel(baike);
		
		return crawlURI;
	}
}
